﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/MasterPageSrch.master" AutoEventWireup="true" Inherits="Search_BasicSearch" Title="PeDALS public search demonstration" Codebehind="BasicSearch.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <%--<h3>Quick Search</h3>--%>
    <p>
        Search term:&nbsp;<asp:TextBox ID="txtSearchValue" runat="server" Width="318px" 
        BorderStyle="None" Font-Bold="True" Font-Size="Medium" ReadOnly="True">Enter term in Quick Search box above</asp:TextBox>
        <asp:Button ID="btnSearch" runat="server" Height="26px" 
            style="margin-left: 9px" Text="Quick Search" 
        onclick="btnSearch_Click" Visible="False" /></p>
        
            <%-- Provenance Repeater for Search Results --%>
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
            <h2><asp:Label ID="lblProvenanceHeader" Visible="false" runat="server" Text="Provenance matches"></asp:Label></h2>
            <div>
            <asp:Label ID="lblNoProvenance" Visible="false" runat="server" Text=""></asp:Label>
        <asp:ListView ID="provListView" runat="server" >
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" ID="tbl1" runat="server">
            <tr id="Tr1" runat="server" style="background-color: #FFFFFF">
              <th id="Th1" runat="server">Provenance</th>
            </tr>
            <tr runat="server" id="itemPlaceholder" />
          </table>
          <asp:DataPager ID="Pager" runat="server"  
                   PagedControlID="provListView" PageSize="5" >                       
        <Fields>
            <asp:numericpagerfield ButtonCount="10" NextPageText="..." 
                PreviousPageText="..." />
            <asp:nextpreviouspagerfield FirstPageText="First" LastPageText="Last" 
                NextPageText="Next" PreviousPageText="Previous" />
        </Fields>
    </asp:DataPager>
          <%--<asp:DataPager ID="DataPager1" runat="server" PagedControlID="provListView" 
            PageSize="20" EnableViewState="True">
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                    ShowLastPageButton="True" />
            </Fields>
        </asp:DataPager>--%>
        </LayoutTemplate>
        <ItemTemplate>
          <tr id="Tr2" runat="server">
            <td>
              <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ProvenanceId", "~/Browse/ProvenanceDetail.aspx?query={0}")%>'> <%# DataBinder.Eval(Container.DataItem, "ProvenanceName")%></asp:HyperLink>
            </td>
          </tr>
        </ItemTemplate>
        </asp:ListView>
    </div>
    
    
    <%--Series Repeater for Search Results--%>
        <h2><asp:Label ID="lblSeriesHeader" Visible="false" runat="server" Text="Series matches"></asp:Label></h2>
    <div>
        <asp:Label ID="lblNoSeries" Visible="false" runat="server" Text=""></asp:Label>
            <asp:ListView ID="seriesListView" runat="server" >
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" ID="tbl1" runat="server">
            <tr id="Tr1" runat="server" style="background-color: #FFFFFF">
              <th id="Th1" runat="server">Series Title</th>
            </tr>
            <tr runat="server" id="itemPlaceholder" />
          </table>
          <asp:DataPager ID="Pager" runat="server"  
                   PagedControlID="seriesListView" PageSize="5" >                       
        <Fields>
            <asp:numericpagerfield ButtonCount="10" NextPageText="..." 
                PreviousPageText="..." />
            <asp:nextpreviouspagerfield FirstPageText="First" LastPageText="Last" 
                NextPageText="Next" PreviousPageText="Previous" />
        </Fields>
    </asp:DataPager>
    <%--Old Code used for pager buttons--%>
          <%--<asp:DataPager ID="DataPager2" runat="server" PagedControlID="seriesListView" 
            PageSize="20" EnableViewState="True">
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                    ShowLastPageButton="True" />
            </Fields>
        </asp:DataPager>--%>
        </LayoutTemplate>
        <ItemTemplate>
          <tr id="Tr2" runat="server">
            <td>
              <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "SeriesId", "~/Browse/ProvenanceDetail.aspx?query={0}")%>'> <%# DataBinder.Eval(Container.DataItem, "SeriesTitle")%></asp:HyperLink>
            </td>
          </tr>
        </ItemTemplate>
        </asp:ListView>
    </div>
    
    <%--Item Repeater for Search Results--%>
    <h2><asp:Label ID="lblItemHeader" Visible="false" runat="server" Text="Item matches"></asp:Label></h2>
    <div>
        <asp:Label ID="lblNoItem" Visible="false" runat="server" Text=""></asp:Label>
            <%--<asp:Repeater ID="rptItemResults" Visible="false" runat="server">
                <ItemTemplate>
                    <li><asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ItemId", "~/Browse/Item.aspx?query={0}")%>'> <%# DataBinder.Eval(Container.DataItem, "ItemTitle") %></asp:HyperLink></li>
                </ItemTemplate>
            </asp:Repeater>--%>
        <asp:ListView ID="itmListView" runat="server" >
        <LayoutTemplate>
          <table cellpadding="2" width="640px" border="1" ID="tbl1" runat="server">
            <tr id="Tr1" runat="server" style="background-color: #FFFFFF">
              <th id="Th1" runat="server">Items</th>
            <%--  <th id="Th2" runat="server"></th>--%>
            </tr>
            <tr runat="server" id="itemPlaceholder" />
          </table>
          <%--<asp:DataPager ID="DataPager3" runat="server" PagedControlID="itmListView" 
            PageSize="20" EnableViewState="True">
            <Fields>
                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                    ShowLastPageButton="True" />
            </Fields>
        </asp:DataPager>--%>
        </LayoutTemplate>
        <ItemTemplate>
          <tr id="Tr2" runat="server">
            <td>
              <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "ItemId", "~/Browse/Item.aspx?query={0}")%>'> <%# DataBinder.Eval(Container.DataItem, "ItemTitle") %></asp:HyperLink>
            </td>
            <%--<td>--%>
              <%-- The following line was commented out by Matt Guzzi 
              <asp:Label ID="Label1" runat="server" Text='<%# Eval("ItemId") %>' />
              --%>
             <%-- <asp:Button ID="btnDownload" runat="server" Text="Download" />
           </td>--%>
          </tr>
        </ItemTemplate>
        </asp:ListView>
    </div>
    <div class="blockheader" style="padding:10px;text-align: left;">
    <asp:DataPager ID="Pager" runat="server"  
                   PagedControlID="itmListView" PageSize="5" >                       
        <Fields>
            <asp:numericpagerfield ButtonCount="10" NextPageText="..." 
                PreviousPageText="..." />
            <asp:nextpreviouspagerfield FirstPageText="First" LastPageText="Last" 
                NextPageText="Next" PreviousPageText="Previous" />
        </Fields>
    </asp:DataPager>
</div>
    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

